﻿// This code is released under the BSD license.
namespace PugLib.Filters
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// Object to hold all fields represented in the FilterBuilder.
    /// 
    /// Also, this class is serialized for saving search filters.
    /// </summary>
    [Serializable]
    public class SearchFilterGroup
    {
        private ICollection<string> _fields;
        private List<SearchFilter> _filters;

        public SearchFilterGroup()
        {
            MatchType = MatchStyle.All;
            _filters = new List<SearchFilter>();
        }

        public MatchStyle MatchType { get; set; }

        public List<SearchFilter> Filters
        {
            get { return _filters; }
        }

        public ICollection<string> Fields
        {
            get { return _fields; }
        }

        public void SetFilters(List<SearchFilter> filters)
        {
            _filters = filters;
        }

        public void SetFields(ICollection<string> fields)
        {
            _fields = fields;
        }
    }
}